package site.luojie.business.user.service;

import site.luojie.business.user.controller.param.UserLoginParam;
import site.luojie.business.user.controller.param.UserRegisterParam;
import site.luojie.business.user.controller.vo.UserVo;
import site.luojie.business.user.pojo.AuthUser;
import site.luojie.common.vo.ResultVo;

/**
 * @author jie.luo
 * @since 2020/9/17
 */
public interface UserService {

    /**
     * 检查用户是否存在
     *
     * @param email 邮箱
     * @return is exist?
     */
    boolean checkExistUser(String email);

    /**
     * 用户注册
     *
     * @param param UserRegisterParam
     * @return ResultVo
     */
    ResultVo<String> register(UserRegisterParam param);

    /**
     * 登录
     *
     * @param param UserLoginParam
     * @return ResultVo
     */
    ResultVo<UserVo> login(UserLoginParam param);

    /**
     * 获取用户信息
     *
     * @param email 邮箱
     * @return AuthUser
     */
    AuthUser getUser(String email);

    /**
     * 检测用户token
     *
     * @param token token
     * @return is matcher?
     */
    Boolean checkToken(String token);
}
